home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / curvewidget.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-10-10  |  1.9 KB  |  102 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef CURVEWIDGET_H
  8. #define CURVEWIDGET_H
  9.  
  10. #include <QWidget>
  11. #include <QEvent>
  12. #include <QMouseEvent>
  13. #include <QKeyEvent>
  14. #include <QPaintEvent>
  15.  
  16. class QEvent;
  17.  
  18. #include "fpointarray.h"
  19. #include "scribusapi.h"
  20.  
  21. class QVBoxLayout;
  22. class QHBoxLayout;
  23. class QPushButton;
  24. class QPixmap;
  25. class QSpacerItem;
  26.  
  27. class SCRIBUS_API KCurve : public QWidget
  28. {
  29.     Q_OBJECT
  30.  
  31. public:
  32.     KCurve(QWidget *parent);
  33.     virtual ~KCurve();
  34.  
  35. protected:
  36.     void paintEvent(QPaintEvent *);
  37.     void keyPressEvent(QKeyEvent *);
  38.     void mousePressEvent (QMouseEvent * e);
  39.     void mouseReleaseEvent ( QMouseEvent * e );
  40.     void mouseMoveEvent ( QMouseEvent * e );
  41.     void leaveEvent ( QEvent * );
  42.  
  43. public:
  44.     double getCurveValue(double x);
  45.     FPointArray getCurve();
  46.     void setCurve(FPointArray inlist);
  47.     void resetCurve();
  48.     void setLinear(bool setter);
  49.     bool isLinear();
  50.  
  51. signals:
  52.     void modified();
  53.  
  54. private:
  55.     double m_leftmost;
  56.     double m_rightmost;
  57.     FPoint m_grab_point;
  58.     int m_pos;
  59.     bool m_dragging;
  60.     bool m_linear;
  61.     double m_grabOffsetX;
  62.     double m_grabOffsetY;
  63.     FPointArray m_points;
  64.     FPointArray m_points_back;
  65. };
  66.  
  67. class SCRIBUS_API CurveWidget : public QWidget
  68. {
  69.     Q_OBJECT
  70.  
  71. public:
  72.     CurveWidget(QWidget* parent);
  73.     ~CurveWidget() {};
  74.     
  75.     virtual void changeEvent(QEvent *e);
  76.     
  77.     void setLinear(bool setter);
  78.     QPushButton* invertButton;
  79.     QPushButton* resetButton;
  80.     QPushButton *linearButton;
  81.     QPushButton* loadButton;
  82.     QPushButton* saveButton;
  83.     KCurve* cDisplay;
  84.  
  85. private slots:
  86.     void doInvert();
  87.     void doReset();
  88.     void doLinear();
  89.     void doLoad();
  90.     void doSave();
  91.  
  92. protected:
  93.     QHBoxLayout* CurveWidgetLayout;
  94.     QVBoxLayout* layout1;
  95.     QSpacerItem* spacer1;
  96.  
  97. protected slots:
  98.     virtual void languageChange();
  99. };
  100.  
  101. #endif // CURVEWIDGET_H
  102.